package com.di.main.hello;

import com.di.model.hello.HelloApi;
import com.di.model.hello.HelloImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 静态工厂
 *
 * @author Roger
 * @since 2021/7/17
 */
public class Hello1Main {

    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring-config.xml");
        // 静态工厂
        HelloApi helloBean3 = ac.getBean("helloBean3", HelloImpl.class);
        helloBean3.sayHello();
    }

}
